<%--
  Created by IntelliJ IDEA.
  User: 18383
  Date: 2023/3/10
  Time: 11:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<html>
<head>
    <title></title>
    <link rel="stylesheet" href="static/plugins/bootstrap-3.4.1/css/bootstrap.min.css">
    <style>
        th, td {
            text-align: center;
            font-size: 14px;
        }

        .status {
            color: #5eb95e;
        }

        td > a, td > a:hover {
            color: #333333;
            text-decoration: none;
        }
    </style>
</head>
<body>
<jsp:include page="layout/nav.jsp"></jsp:include>

<div class="container">
    <div class="panel panel-info">
        <!-- Default panel contents -->
        <div class="panel-heading" style="font-weight: bold">订单列表</div>

        <!-- Table -->
        <table class="table table-hover">
            <thead>
            <tr>
                <th>订单号</th>
                <th>订单详情</th>
                <th>购买数量</th>
                <th>价格</th>
                <th>订单状态</th>
                <th>下单时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <c:if test="${empty requestScope.order_list}">
                <tr>
                    <td colspan="7" class="text-muted" style="font-size: 16px;text-align: center;line-height: 50px;">当前购物车还没有商品 ~ ~ ~ </td>
                </tr>
            </c:if>
            <c:forEach items='${requestScope.order_list}' var="order" varStatus="loop">
                <tr>
                    <td style="font-weight:bold">${order.order_id}</td>
                    <td>${requestScope.book_name.get(loop.count-1)}</td>
                    <td>${order.buy_num}</td>
                    <td class="text-muted">
                        <span>￥</span>
                        <span>${order.price}</span>
                    </td>
                    <td class="status">${order.statue}</td>
                    <td class="text-muted">${fn:substring(order.create_time, 0, 19)}</td>
                    <td>
                        <a href="/order?m=deleteCurrentUserOrder&order_id=${order.order_id}&uid=${order.user_id}" class="btn btn-danger btn-xs">
                            <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
                            删除
                        </a>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
</div>
<script src="static/js/jquery-3.6.3.min.js"></script>
<script src="static/plugins/bootstrap-3.4.1/js/bootstrap.min.js"></script>
</body>
</html>
